<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Add Room</title>

 <script type="text/javascript">
 	  function kt(){  
         	var   roomnameKT =  document.getElementById("roomname1").value;
       	        if(roomnameKT==""){
       	        	alert(" Please enter correct room name!");
                	return false;
                }

    	    var  floor1 = document.getElementById("floor1").value;
    	        if(isNaN(floor1) ||floor1<=0||s>1000){
    	        	alert(" Please enter correct floor!");
             	return false;
             }   
    	    var roomNumber1 = document.getElementById("roomNumber1").value;
    	        if(isNaN(roomNumber1) ||roomNumber1<=0||roomNumber1>100000){
    	        	alert(" Please enter correct room number!");
             	return false;
             } 
    	 	 var building1 = document.getElementById("building1").value;
 		        if(building1=="" ||building1<=0){
 		        	alert(" Please enter correct building!");
     	     	return false;
     	     }   
 		  	 var status1 = document.getElementById("status1").value;
		        if(status1=="Select"||status1==""){
		        	alert(" Please enter select status!");
  	  		   	return false;
  	 	    }   
                return true;
            }
        </script>
</head>

<body>

<div id="insForm">
	<s:actionerror />
	<s:form action="doAddRoom" method="post" validate="true">
		<s:textfield name="roomname" key="Room name" size="20" id="roomname1"/>
		<s:textfield name="floor" key="Floor" size="20" id="floor1"/>
		<s:textfield name="roomNumber" key="Room Number" size="20" id="roomNumber1" />
		<s:textfield name="building" key="Building" size="20" id="building1"/>
		<td><s:select name="status" list="{'true','false'}"
			headerKey="" headerValue="Select"
			label="Select a value" id="status1"/></td>
		<s:submit method="execute" cssClass="button" key="Add room" align="center" onclick="return kt()"/>
	</s:form>
</div>
	
</body>
</html>